package com.session01;

public class Feeder {
    String name;

    public double feedAnimal(Animal animal, Food food, int amount) {
        animal.eat(food.getFoodName());
        return food.getFoodPrice() * amount;
    }

    public double washAnimal(Animal animal) {
        double washPrice = 0;
        if (animal.getHair()) {
            washPrice = 200;
        } else {
            washPrice = 100;
        }
        return washPrice;
    }

    public void playAnimal(Animal animal) {
        if (animal instanceof Cat) {
            ((Cat) animal).play();
        } else if (animal instanceof Dog) {
            ((Dog) animal).play();
        }
    }

    public double workAnimal(Animal animal){
        if (animal instanceof Dog){
            ((Dog) animal).walk();
        }
        return 10;
    }
}
